#ifndef __SUPERPOSICION_H__
#define __SUPERPOSICION_H__

#include <sys/stat.h>
#include <ctype.h>
#include "overlap.h"
#include <string.h>
#include <math.h>
#include <stdio.h>

#include "Element.h"


typedef struct resultadosuperposicion {
	int superposicion;
	int X;
	int Y;
	float distancia;
	char* idElem1;
    char* idElem2;
} OverlapResult;



OverlapResult squareToSquare(Element* s1,Element* s2);
OverlapResult squareToCircle(Element* s1,Element* c2);
OverlapResult squareToSegment(Element* s1,Element* s2);
OverlapResult squareToRectangle(Element* s1,Element* r2);
OverlapResult circleToRectangle(Element* c1,Element* r2);
OverlapResult segmentToRectangle(Element* s1,Element* r2);
OverlapResult rectangleToRectangle(Element* r1,Element* r2);
OverlapResult segmentToCircle(Element* s1,Element* c2);
OverlapResult circleToCircle(Element* c1,Element* c2);
OverlapResult segmentToSegment(Element* s1,Element* s2);


// estas funciones vendrian a ser como "privadas"

OverlapResult superposicionSegmentos(int x1i, int y1i, int x1f, int y1f, int x2i, int y2i, int x2f, int y2f);

OverlapResult superposicionCuadrados(int x1, int y1, int h1, int w1, int x2, int y2, int h2, int w2);

OverlapResult superposicionCirculos(int x1, int y1, int r1, int x2, int y2, int r2);

OverlapResult superposicionCirculoCuadrado(int x1, int y1, int h1, int w1, int x2, int y2, int r2);

OverlapResult superposicionSegmentoCirculo(int x1i, int y1i, int x1f, int y1f, int x2, int y2, int r2);

OverlapResult superposicionSegmentoCuadrado (int x1i, int y1i, int x1f, int y1f, int x2, int y2, int h2, int w2);

float calcularDistanciaOrigen (int x1, int y1);

void mostrameCercano (int xMenor, int xMayor, int yMenor, int yMayor, float a, float b, int *xCercano, int* yCercano, float* distanciaXY);

#endif
